﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Media3D;
using MathNet.Numerics.LinearAlgebra.Double;


namespace TeaStlShow
{
    public class alg
    {
        public void ddd(List<Point3D> point,List<Vector3D> normal)
        {
            List<Vector3D> ix, iy, iz;
            for (int i = 0; i < point.Count; i++) { 
                if(i == 0)
                {

                }
            }
        
        }
        private Matrix3D orth(Vector3D x, Vector3D z)
        {
            Vector3D iy = new Vector3D();
            iy = Vector3D.CrossProduct(z, x);
            Vector3D ix = new Vector3D();
            ix = Vector3D.CrossProduct(iy, z);
            iy = Vector3D.CrossProduct(z, ix);

            Matrix3D rotationMatrix = new Matrix3D(
                                   ix.X, iy.X, z.X, 0,
                                   ix.Y, iy.Y, z.Y, 0,
                                   ix.Z, iy.Z, z.Z, 0,
                                    0, 0, 0, 1);
            return rotationMatrix;

        }

        private Matrix3D rotationFromTwoVectors(Vector3D v1, Vector3D v2) { 
            Matrix3D rotationMatrix;
            AxisAngleRotation3D aa = new AxisAngleRotation3D();
            aa.Angle = Math.Acos(Vector3D.DotProduct(v1, v2)) / Math.PI * 180;
            aa.Axis = Vector3D.CrossProduct(v1, v2);
            System.Windows.Media.Media3D.Quaternion q = new System.Windows.Media.Media3D.Quaternion();
            //AxisAngleRotation3D..
            return rotationMatrix;
        }
    }
}
